package com.hd.day04;

public class Example02 {
    public static void main(String[] args) {
        int[][] arr = new int[3][3];
        arr[0] = new int[]{1, 2, 3};
        arr[1] = new int[]{4, 5, 6};
        arr[2] = new int[]{7, 8, 9};


        // 向右
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[0][i] + "\t");
        }
        System.out.println();
        // 向下
        for (int i = 1; i < arr.length; i++) {
            System.out.print(arr[i][2] + "\t");
        }
        System.out.println();
        // 向左
        for (int i = 1; i >= 0; i--) {
            System.out.print(arr[2][i] + "\t");
        }
        System.out.println();
        // 向上
        for (int i = 1; i > 0; i--) {
            System.out.print(arr[i][0] + "\t");
        }

    }
}
